package com.iecg.controller.weixin;


import com.iecg.api.entity.IecgUser;
import com.iecg.service.IecgUserService;
import com.pig4cloud.pigx.common.core.util.R;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("weixin/openid" )
@Api(value = "weixin_openid", tags = "Weixin获取openid")
public class WeixinOpenIdController {

	private final IecgUserService iecgUserService;

	/**
	 * 获取token
	 * @return
	 */
	@GetMapping
	public R get(){
		IecgUser iecgUser = iecgUserService.getSecurityUser();
		return R.ok(iecgUser.getOpenId());
	}


}
